package com.slmxz.tms.biz.model.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Getter;
import lombok.Setter;
import com.baomidou.mybatisplus.annotation.TableName;
import com.slmxz.tms.common.base.BaseEntity;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 订单实体对象
 *
 * @author sunyao
 *@Date 2024-10-08 16:58
 */
@Getter
@Setter
@TableName("biz_order")
public class Order extends BaseEntity {

    @TableId(value = "id")
    private Long id;

    private Long companyId;
    /**
     * 部门ID
     */
    private Long deptId;
    /**
     * 系统订单号
     */
    private String orderNo;
    /**
     * 订单状态:来自于字典
     */
    private Integer orderStatus;
    /**
     * 并单的订单，原订单保存并后的订单号,拆单的订单,拆后的订单保存拆单时的订单号
     */
    private String specialOrderNo;
    /**
     * 特殊操作类型,1=没有发生拆并的订单,2=拆后的订单,3=并后的订单
     */
    private Integer specialType;
    /**
     * 客户ID
     */
    private Long customerId;
    /**
     * 运输类型:来自于字典
     */
    private Integer transportType;
    /**
     * 客户订单号
     */
    private String customerOrderNo;
    /**
     * 订单件数
     */
    private Integer pcs;
    /**
     * 订单重量
     */
    private BigDecimal weight;
    /**
     * 订单体积
     */
    private BigDecimal volume;
    /**
     * 订单总价值
     */
    private BigDecimal orderPrice;
    /**
     * 调度单号
     */
    private String dispatchNo;
    /**
     * 预计发运时间
     */
    @JsonInclude(value = JsonInclude.Include.NON_NULL)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime planShipTime;
    /**
     * 实际发运时间
     */
    @JsonInclude(value = JsonInclude.Include.NON_NULL)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime actualShipTime;
    /**
     * 预计到达时间
     */
    @JsonInclude(value = JsonInclude.Include.NON_NULL)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime planArriveTime;
    /**
     * 实际到达时间
     */
    @JsonInclude(value = JsonInclude.Include.NON_NULL)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime actualArriveTime;

    /**
     * 结算方式: 1=合同计费,2=议价
     */
    private Integer settleType;
    /**
     * 运输费金额
     */
    private BigDecimal transportFareAmount;
    /**
     * 备注
     */
    private String remark;
}
